import tensorflow as tf

INPUT_NODE=31
LAYER1_NODE=80
LAYER2_NODE=40
LAYER3_NODE=4
OUTPUT_NODE=1

def get_weight_variable(shape,name):
    weights=tf.get_variable(name,shape,initializer=tf.truncated_normal_initializer(stddev=0.1))
    return weights

def get_dnn_net(input):
    with tf.variable_scope('layer1',reuse=tf.AUTO_REUSE):
        weights=get_weight_variable([INPUT_NODE,LAYER1_NODE],name="weights_layer1")
        biases=tf.get_variable("biase_layer1",[LAYER1_NODE],initializer=tf.constant_initializer(0.0))
        output_layer1=tf.nn.relu(tf.matmul(input,weights)+biases)
    with tf.variable_scope('layer2',reuse=tf.AUTO_REUSE):
        weights=get_weight_variable([LAYER1_NODE,LAYER2_NODE],name="weights_layer2")
        biases=tf.get_variable("biase_layer2",[LAYER2_NODE])
        output_layer2=tf.nn.relu(tf.matmul(output_layer1,weights)+biases)
    with tf.variable_scope('layer3',reuse=tf.AUTO_REUSE):
        weights=get_weight_variable([LAYER2_NODE,LAYER3_NODE],name="weights_layer3")
        biases=tf.get_variable("biase_layer3",[LAYER3_NODE])
        output_layer3=tf.nn.relu(tf.matmul(output_layer2,weights)+biases)
    with tf.variable_scope('output',reuse=tf.AUTO_REUSE):
        weights=get_weight_variable([LAYER3_NODE,OUTPUT_NODE],name="weights_output")
        biases=tf.get_variable("biase_output",[OUTPUT_NODE])
        output=tf.nn.relu(tf.matmul(output_layer3,weights)+biases)
    return output
